//运行程序前 需要通过cmd：redis-server.exe redis.conf来启动
package redis.spring.watson;



import redis.clients.jedis.Jedis;

public class RedisUtil {
	public void RedisUtil(){
		
	}
	private final static String redisAddress = "127.0.0.1";
	private final static Jedis jedis = new Jedis(redisAddress);

	public static Object getRedisValue(String keys) {
    return jedis.get(keys);
	}

	public static void setRedisValue(String key,String obj){
    jedis.del(key);
    jedis.set(key,obj);
	}

	
	public static void main(String[] args) {
    RedisUtil.setRedisValue("name", "ganjing");
    Object name= RedisUtil.getRedisValue("name");
    System.out.println(name.toString());
	}
}